package com.zhaokuner.parentstarter.common;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 类描述:请求分页
 *
 * @author 赵希坤 zhaoxikun
 * @date 2020/12/14 15:03
 */
public class BaseListAO {
    /**
     * 分页页码
     */
    @NotNull(message = "请输入分页页码")
    protected Integer pageIndex;
    /**
     * 分页查询条数 最小1，最大100
     */
    @NotNull(message = "请输入分页查询条数")
    @Max(value = 5000, message = "分页条数不可大于5000")
    @Min(value = 1, message = "分页条数不可小于1")
    protected Integer pageSize;
    /**
     * 分页标志
     */
    protected String pageFlag;

    public BaseListAO() {
    }

    public BaseListAO(Integer pageIndex, Integer pageSize) {
        this.pageSize = pageSize;
        this.pageIndex = pageIndex;
    }

    public BaseListAO(BaseListAO ao) {
        this.pageFlag = ao.getPageFlag();
        this.pageIndex = ao.getPageIndex();
        this.pageSize = ao.getPageSize();
    }


    public Integer getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getPageFlag() {
        return pageFlag;
    }

    public void setPageFlag(String pageFlag) {
        this.pageFlag = pageFlag;
    }

    @Override
    public String toString() {
        return "BaseListAO{" +
                "pageIndex=" + pageIndex +
                ", pageSize=" + pageSize +
                ", pageFlag='" + pageFlag + '\'' +
                '}';
    }
}
